package com.sc.nft.dao;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sc.nft.entity.PushRelationTag;
import com.sc.nft.mapper.PushRelationTagMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Repository;
import java.util.List;

/**
 * @author 刘国航
 * @desc
 * @since 2024/6/14 16:10
 */
@Slf4j
@Repository
public class PushRelationTagDao extends ServiceImpl<PushRelationTagMapper, PushRelationTag> {

    public List<PushRelationTag> getListByPushId(Long pushId) {
        LambdaQueryWrapper<PushRelationTag> queryWrapper = Wrappers.lambdaQuery();
        queryWrapper.eq(PushRelationTag::getPushId, pushId);
        return baseMapper.selectList(queryWrapper);
    }

    public List<PushRelationTag> getListByPushIdList(List<Long> pushIdList) {
        LambdaQueryWrapper<PushRelationTag> queryWrapper = Wrappers.lambdaQuery();
        queryWrapper.in(PushRelationTag::getPushId, pushIdList);
        return baseMapper.selectList(queryWrapper);
    }

}
